home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / msdos / osd_dbg.h < prev    next >
C/C++ Source or Header  |  1999-07-08  |  3KB  |  124 lines

  1. #ifndef _OSD_DBG_H
  2. #define _OSD_DBG_H
  3.  
  4. #ifdef MAME_DEBUG
  5.  
  6. #include <dos.h>
  7. #include <conio.h>
  8. #include <time.h>
  9.  
  10. #define ARGFMT  __attribute__((format(printf,2,3)))
  11.  
  12. #ifndef DECL_SPEC
  13. #define DECL_SPEC
  14. #endif
  15.  
  16. #ifndef TRUE
  17. #define TRUE    1
  18. #endif
  19.  
  20. #ifndef FALSE
  21. #define FALSE    0
  22. #endif
  23.  
  24. #ifndef INVALID
  25. #define INVALID 0xffffffff
  26. #endif
  27.  
  28. #ifndef WIN_EMPTY
  29. #define WIN_EMPTY   '°'
  30. #endif
  31. #ifndef CAPTION_L
  32. #define CAPTION_L   '®'
  33. #endif
  34. #ifndef CAPTION_R
  35. #define CAPTION_R   '¯'
  36. #endif
  37. #ifndef FRAME_TL
  38. #define FRAME_TL    'Ú'
  39. #endif
  40. #ifndef FRAME_BL
  41. #define FRAME_BL    'À'
  42. #endif
  43. #ifndef FRAME_TR
  44. #define FRAME_TR    '¿'
  45. #endif
  46. #ifndef FRAME_BR
  47. #define FRAME_BR    'Ù'
  48. #endif
  49. #ifndef FRAME_V
  50. #define FRAME_V     '³'
  51. #endif
  52. #ifndef FRAME_H
  53. #define FRAME_H     'Ä'
  54. #endif
  55.  
  56. /***************************************************************************
  57.  *
  58.  * These functions have to be provided by the OS specific code
  59.  *
  60.  ***************************************************************************/
  61.  
  62. static void osd_screen_update(void);
  63. static void osd_put_screen_char (int ch, int attr, int x, int y);
  64. static void osd_set_screen_curpos (int x, int y);
  65.  
  66. /***************************************************************************
  67.  * Note: I renamed the set_gfx_mode function to avoid a name clash with
  68.  * DOS' allegro.h. The new function should set any mode that is available
  69.  * on the platform and the get_screen_size function should return the
  70.  * resolution that is actually available.
  71.  * The minimum required size is 80x25 characters, anything higher is ok.
  72.  ***************************************************************************/
  73. static void osd_set_screen_size (unsigned width, unsigned height);
  74. static void osd_get_screen_size (unsigned *width, unsigned *height);
  75.  
  76. #include <dos.h>
  77. #include <conio.h>
  78.  
  79. /*
  80.  * Since this file is only to be included from mamedbg.c,
  81.  * I put the following small function bodies in here.
  82.  */
  83.  
  84. static void osd_screen_update(void)
  85. {
  86.     /* nothing to do */
  87. }
  88.  
  89. static void osd_put_screen_char(int ch, int attr, int x, int y)
  90. {
  91.     ScreenPutChar(ch,attr,x,y);
  92. }
  93.  
  94. static void osd_set_screen_curpos(int x, int y)
  95. {
  96.     ScreenSetCursor(y,x);
  97. }
  98.  
  99. /* DJGPPs conio.h text_info structure */
  100. static struct text_info textinfo;
  101.  
  102. static void osd_set_screen_size( unsigned width, unsigned height )
  103. {
  104.     union REGS r;
  105.  
  106.     gppconio_init();
  107.     _set_screen_lines( height );
  108.     r.x.ax = 0x1003;   /* set intensity/blinking */
  109.     r.x.bx = 0;        /* intensity mode */
  110.     int86( 0x10, &r, &r );
  111.     gettextinfo( &textinfo );
  112. }
  113.  
  114. static void osd_get_screen_size( unsigned *width, unsigned *height )
  115. {
  116.     *width = textinfo.screenwidth;
  117.     *height = textinfo.screenheight;
  118. }
  119.  
  120. #endif  /* MAME_DEBUG */
  121.  
  122. #endif    /* _OSD_DBG_H */
  123.  
  124.